package Interfaz;

import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Monitor;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Text;
import org.eclipse.wb.swt.SWTResourceManager;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Control;


/**
 * CU010 - Modificar participante
 * @author 
 */
public class CU010 {

	protected Shell shlNuevoParticipante;
	private Text text;
	private Text text_1;
	private Label lblImagen;
	private Label label;
	private Text txtCimagenes;
	private Button btnNewButton;
	private Button btnCancelar;
	private Button btnAceptar;

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			CU010 window = new CU010();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		
		// Centrar ventana
		Monitor primary = display.getPrimaryMonitor();
		Rectangle bounds = primary.getBounds();
		Rectangle rect = shlNuevoParticipante.getBounds();
		int x = bounds.x + (bounds.width - rect.width) / 2;
		int y = bounds.y + (bounds.height - rect.height) / 2;	    
		shlNuevoParticipante.setLocation(x, y);
		
		txtCimagenes = new Text(shlNuevoParticipante, SWT.BORDER);
		txtCimagenes.setText("C:\\Imágenes\\default.jpeg");
		txtCimagenes.setBounds(59, 92, 375, 21);
		shlNuevoParticipante.setTabList(new Control[]{text, text_1, btnNewButton, btnCancelar, btnAceptar, txtCimagenes});
		
		shlNuevoParticipante.open();
		shlNuevoParticipante.layout();
		while (!shlNuevoParticipante.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shlNuevoParticipante = new Shell(SWT.CLOSE | SWT.TITLE | SWT.MIN);
		shlNuevoParticipante.setSize(450, 356);
		shlNuevoParticipante.setText("Editar participante");
		
		text = new Text(shlNuevoParticipante, SWT.BORDER);
		text.setBounds(171, 12, 219, 21);
		
		text_1 = new Text(shlNuevoParticipante, SWT.BORDER);
		text_1.setMessage("ejemplo@ejemplo.com");
		text_1.setBounds(117, 52, 219, 21);
		
		Label lblNombreParticipanteequipo = new Label(shlNuevoParticipante, SWT.NONE);
		lblNombreParticipanteequipo.setText("Nombre participante/equipo:");
		lblNombreParticipanteequipo.setBounds(10, 15, 155, 15);
		
		Label lblEmail = new Label(shlNuevoParticipante, SWT.NONE);
		lblEmail.setText("Correo electr\u00F3nico:");
		lblEmail.setBounds(10, 55, 101, 15);
		
		lblImagen = new Label(shlNuevoParticipante, SWT.NONE);
		lblImagen.setBounds(10, 95, 43, 15);
		lblImagen.setText("Imágen:");
		
		label = new Label(shlNuevoParticipante, SWT.NONE);
		label.setImage(SWTResourceManager.getImage(CU010.class, "/Interfaz/Images/default.png"));
		label.setBounds(176, 132, 93, 112);
		
		btnNewButton = new Button(shlNuevoParticipante, SWT.NONE);
		btnNewButton.setBounds(340, 127, 84, 25);
		btnNewButton.setText("Examinar ...");
		
		btnCancelar = new Button(shlNuevoParticipante, SWT.NONE);
		btnCancelar.setText("Cancelar");
		btnCancelar.setBounds(316, 275, 108, 32);
		
		btnAceptar = new Button(shlNuevoParticipante, SWT.NONE);
		btnAceptar.setText("Aceptar");
		btnAceptar.setBounds(184, 275, 108, 32);

	}
}
